    {include file="../view/head" /}
    <style>
        label i{font-weight: normal;}
        input[type=text] {min-width: 50px;}
    </style>
    </head>
    <body>
        {include file="../view/header" /}
        {include file="../view/sidebar" /}
        {include file="../view/right-sidebar" /}
        <!-- Start #content -->
        <div id="content">
            <!-- Start .content-wrapper -->
            <div class="content-wrapper">
                <div class="row">
                    <!-- Start .row -->
                    <!-- Start .page-header -->
                    <div class="col-lg-12 heading hidden-xs hidden-sm">
                        <!-- Start .bredcrumb -->
                        <ul id="crumb" class="breadcrumb"></ul>
                        <!-- End .breadcrumb -->
                    </div>
                    <!-- End .page-header -->
                </div>
                <!-- End .row -->
                <div class="outlet">
                    <!-- Start .outlet -->
                    <!-- Page start here ( usual with .row ) -->
                    <div class="row">
                        <div class="col-lg-12">
                            <!-- Start col-lg-12 -->
                            <div class="panel panel-default panel-closed toggle panelRefresh panelClose showControls">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="im-settings"></i>通用配置</h3>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal group-border hover-stripped" method="post" action="#">
                                        {:token()}
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">系统开关</label>
                                            <div class="col-md-4">
                                                <label class="radio" onclick="$('#sisclose_msg').hide();">
                                                    <input type="radio" name="sisclose" value="0" {$setting.sisclose?'':'checked="checked"'}>开启APP
                                                </label>
                                                <label class="radio" onclick="$('#sisclose_msg').show();">
                                                    <input type="radio" name="sisclose" value="1" {$setting.sisclose?'checked="checked"':''}>关闭APP
                                                </label>
                                            </div>
                                            <div class="col-md-6" id="sisclose_msg">
                                                <div class="input-group">
                                                    <span class="input-group-addon">关闭消息</span>
                                                    <textarea name="sisclose_msg" class="form-control">{$setting.sisclose_msg}</textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">APP首页跑马信息<br><i>（留空则关闭）</i></label>
                                            <div class="col-md-10">
                                                <textarea name="paoma" class="form-control">{$setting.paoma}</textarea>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">系统关键项操作密码</label>
                                            <div class="col-md-10">
                                                <input type="password" class="form-control" name="sispwd" value="{$setting.sispwd}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">用户默认支付密码</label>
                                            <div class="col-md-10">
                                                <input type="text" class="form-control" name="nopwd" value="{$setting.nopwd}">
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">短信验证码有效期</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="text" class="form-control" name="sms_time" value="{$setting.sms_time}">
                                                    <span class="input-group-addon">秒后过期</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">年龄段限制</label>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">最小</span>
                                                    <input type="number" class="form-control" name="age_min" min="1" max="70" value="{$setting.age_min}">
                                                </div>
                                            </div>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">最大</span>
                                                    <input type="number" class="form-control" name="age_max" min="1" max="70" value="{$setting.age_max}">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">禁止注册号段</label>
                                            <div class="col-md-10">
                                                <input type="text" class="form-control" name="no_register" value="{$setting.no_register}">
                                                <p class="help-block">多个号段中间用逗号(,)分开</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">授权ip地址</label>
                                            <div class="col-md-10">
                                                <input type="text" class="form-control" name="allow_ip" value="{$setting.allow_ip}">
                                                <p class="help-block">多个中间用逗号(,)分开</p>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">在线客服微信号</label>
                                            <div class="col-md-10">
                                                <input type="text" class="form-control" name="zx_kf" value="{$setting.zx_kf}">
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <div class="col-lg-12 col-md-12">
                                            <input type="submit" class="btn btn-primary btn-block" value="提交">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>

                        <div class="col-lg-12">
                            <!-- Start col-lg-12 -->
                            <div class="panel panel-default panel-closed toggle panelRefresh panelClose showControls">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="im-settings"></i>挂单配置</h3>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal group-border hover-stripped" method="post" action="#">
                                        {:token()}
                                        <div class="form-group">
                                        <label class="col-md-2 col-sm-12 col-xs-12 control-label">交易当前价格</label>
                                        <div class="col-md-10">
                                            <div class="input-group">
                                            <input type="number" class="form-control" name="current_price" value="{$setting.current_price}">
                                                <span class="input-group-addon">元</span>
                                            </div>
                                        </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">开盘价每天涨幅范围</label>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">最小值：</span>
                                                    <input type="number" class="form-control" name="increase_min" min="1" value="{$setting.increase_min}">
                                                    <span class="input-group-addon">分</span>
                                                </div>
                                            </div>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">最大值：</span>
                                                    <input type="number" class="form-control" name="increase_max" min="1" value="{$setting.increase_max}">
                                                    <span class="input-group-addon">分</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">单个账号挂单数量限制</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="guadan_max" min="1" max="20" value="{$setting.guadan_max}">
                                                    <span class="input-group-addon">个</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">最少求购数</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="guadan_buy_num_min" min="1" max="20" value="{$setting.guadan_buy_num_min}">
                                                    <span class="input-group-addon">个</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">单号求购单数</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="account_buy_mum" min="1" max="20" value="{$setting.account_buy_mum}">
                                                    <span class="input-group-addon">个</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">交易开关</label>
                                                <div class="col-md-10">
                                                    <input name="jiaoyi_switch" type="radio" value='0' <?php if ($setting['jiaoyi_switch']==0){?> checked="checked" <?php }?> >开启
                                                    <input name="jiaoyi_switch" type="radio" value='1' <?php if ($setting['jiaoyi_switch']==1){?> checked="checked" <?php }?> >关闭
                                                </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">开盘时间</label>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">开始</span>
                                                    <input type="number" class="form-control" name="open_time" min="1" max="23" value="{$setting.open_time}">
                                                    <span class="input-group-addon">点</span>
                                                </div>
                                            </div>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">结束</span>
                                                    <input type="number" class="form-control" name="open_time_end" min="1" max="23" value="{$setting.open_time_end}">
                                                    <span class="input-group-addon">点</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">超时未付款自动取消(单位:分钟)</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="repay_cancel" min="1" value="{$setting.repay_cancel}">
                                                    <span class="input-group-addon">分钟</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">未放币交易自动完成(单位:分钟)</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="send_coin" min="1" value="{$setting.send_coin}">
                                                    <span class="input-group-addon">分钟</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">挂单之后多久可以撤单(单位:分钟)</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="jiaoyi_undo_time" min="1" value="{$setting.jiaoyi_undo_time}">
                                                    <span class="input-group-addon">分钟</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <div class="col-lg-12 col-md-12">
                                                <input type="submit" class="btn btn-primary btn-block" value="提交">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-12">
                            <!-- Start col-lg-12 -->
                            <div class="panel panel-default panel-closed toggle panelRefresh panelClose showControls">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="im-settings"></i>手续费配置</h3>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal group-border hover-stripped" method="post" action="#">
                                        {:token()}
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">出售手续费</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="sell_fee" value="{$setting.sell_fee}">
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">转账手续费</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="transfer_fee" min="1" value="{$setting.transfer_fee}">
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">买家处罚</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="buy_fee" value="{$setting.buy_fee}">
                                                    <span class="input-group-addon">个币</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">一个手机号每天最多发短信数</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="sms_num" min="1" max="20" value="{$setting.sms_num}">
                                                    <span class="input-group-addon">次</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">买家超时</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="qiugou_cancel_num" min="1" max="20" value="{$setting.qiugou_cancel_num}">
                                                    <span class="input-group-addon">次封号</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">卖家超时</label>
                                            <div class="col-md-10">
                                                <div class="input-group">
                                                    <input type="number" class="form-control" name="sell_timeout_num" min="1" max="20" value="{$setting.sell_timeout_num}">
                                                    <span class="input-group-addon">次封号</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-2 col-sm-12 col-xs-12 control-label">每天获取收益时间</label>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">开始</span>
                                                    <input type="number" class="form-control" name="income_start" min="1" max="24" value="{$setting.income_start}">
                                                    <span class="input-group-addon">点</span>
                                                </div>
                                            </div>
                                            <div class="col-md-5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">结束</span>
                                                    <input type="number" class="form-control" name="income_end" min="1" max="24" value="{$setting.income_end}">
                                                    <span class="input-group-addon">点</span>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <div class="col-lg-12 col-md-12">
                                                <input type="submit" class="btn btn-primary btn-block" value="提交">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <?php
                        $share_reward = json_decode($setting['share_reward'],true);
                        $union_reward = json_decode($setting['union_reward'],true);
                        ?>
                        <div class="col-lg-12">
                            <!-- Start col-lg-12 -->
                            <div class="panel panel-default panel-closed toggle panelRefresh panelClose showControls">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="im-settings"></i>奖励设置</h3>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal group-border hover-stripped" method="post" action="#">
                                        {:token()}
                                        <div class="form-group">
                                            <label class="col-md-1 col-sm-12 col-xs-12 control-label">分享奖励</label>
                                            <div class="col-md-11">
                                                <div class="input-group mb5">
                                                    <span class="input-group-addon">邀请后上级赠送</span>
                                                    <input type="text" class="form-control" name="tj_reward" value="{$setting.tj_reward}">
                                                    <span class="input-group-addon">币，释放</span>
                                                    <input type="text" class="form-control" name="tj_reward_time" value="{$setting.tj_reward_time}">
                                                    <span class="input-group-addon">天</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-1 col-sm-12 col-xs-12 control-label">直推奖（烧伤）</label>
                                            <div class="col-md-11">
                                                <div class="input-group mb5">
                                                    <span class="input-group-addon">邀请人矿机收益后上级收益奖励</span>
                                                    <input type="text" class="form-control" name="tj_reward_tname" value="{$setting.tj_reward_tname}">
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-1 col-sm-12 col-xs-12 control-label">分享奖励</label>
                                            <div class="col-md-11">
                                            {foreach $share_reward as $key => $val}
                                              <div class="input-group mb5">
                                                <span class="input-group-addon">直推</span>
                                                <input type="text" class="form-control" name="share_reward[{$key}][num]" value="{$val.num}">
                                                <span class="input-group-addon">人,团队算力</span>
                                                <input type="text" class="form-control" name="share_reward[{$key}][power]" value="{$val.power}">
                                                <span class="input-group-addon">G,赠送1台</span>
                                                  <select name="share_reward[{$key}][kj_id]" class="form-control">
                                                      {foreach $kj_list as $k => $v}
                                                      <option value="{$v.id}" <?php if ($val['kj_id']==$v['id']){?> selected="selected" <?php }?>>{$v.name}</option>
                                                      {/foreach}
                                                  </select>
                                              </div>
                                            {/foreach}
                                          </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-1 col-sm-12 col-xs-12 control-label">工会奖励</label>
                                            <div class="col-md-11">
                                                {foreach $union_reward as $key => $val}
                                                <div class="input-group mb5">
                                                    <span class="input-group-addon">{$key+1}级工会：直推</span>
                                                    <input type="text" class="form-control" name="union_reward[{$key}][num]" value="{$val.num}">
                                                    <span class="input-group-addon">人,</span>
                                                    <input type="text" class="form-control" name="union_reward[{$key}][member]" value="{$val.member}">
                                                    <span class="input-group-addon">{if $key>=2}个{$key-1}会员{else}个会员{/if}，团队活跃</span>
                                                    <input type="text" class="form-control" name="union_reward[{$key}][active]" value="{$val.active}">
                                                    <span class="input-group-addon">人，工会算力</span>
                                                    <input type="text" class="form-control" name="union_reward[{$key}][power]" value="{$val.power}">
                                                    <span class="input-group-addon">G，送一台</span>
                                                    <!--<input type="text" class="form-control" name="union_reward[{$key}][kj_id]" value="{$val.kj_id}">-->
                                                    <select name="union_reward[{$key}][kj_id]" class="form-control">
                                                        {foreach $kj_list as $k => $v}
                                                        <option value="{$v.id}" <?php if ($val['kj_id']==$v['id']){?> selected="selected" <?php }?> >{$v.name}</option>
                                                        {/foreach}
                                                    </select>
                                                    <span class="input-group-addon">矿机,返当天交易的</span>
                                                    <input type="text" class="form-control" name="union_reward[{$key}][rate]" value="{$val.rate}">
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                                {/foreach}
                                            </div>
                                        </div>




                                        <div class="form-group">
                                            <div class="col-lg-12 col-md-12">
                                                <input type="submit" class="btn btn-primary btn-block" value="提交">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!-- Page End here -->
                </div>
                <!-- End .outlet -->
            </div>
            <!-- End .content-wrapper -->
            <div class="clearfix"></div>
        </div>
        <!-- End #content -->
        {include file="../view/foot" /}
        <script src="/public/theme/win10/assets/plugins/forms/select2/select2.js"></script>
        <script src="/public/theme/win10/assets/plugins/forms/icheck/jquery.icheck.js"></script>
        <script src="/public/theme/win10/assets/plugins/forms/tags/jquery.tagsinput.min.js"></script>
        <script>
            $('.select2').select2({placeholder: '请选择...'});
            $('input').iCheck();
            $('#k_times').tagsInput({
                // 'autocomplete_url': url_to_autocomplete_api,
                // 'autocomplete': { option: value, option: value},
                'height':'auto',
                'width':'auto',
                'interactive':true,
                'defaultText':'添加，格式00:00',
                'onAddTag':function (val){
                    if(!/[0-2][0-9]:[0-5][0-9]/g.test(val)){
                        alert('时间格式不正确，请严格按照00:00书写');
                        $('#k_times').removeTag(val);
                    }
                },
                // 'onRemoveTag':callback_function,
                // 'onChange' : callback_function,
                'delimiter': [','],   // Or a string with a single delimiter. Ex: ';'
                'removeWithBackspace' : true,
                'minChars' : 5,
                'maxChars' : 5, // if not provided there is no limit
                'placeholderColor' : '#666666'
            });
            $('#q_moneys').tagsInput({
                // 'autocomplete_url': url_to_autocomplete_api,
                // 'autocomplete': { option: value, option: value},
                'height':'auto',
                'width':'auto',
                'interactive':true,
                'defaultText':'添加整数',
                'onAddTag':function (val){
                    if(parseInt(val, 10)!=val){
                        alert('格式不正确，请添加整数');
                        $('#q_moneys').removeTag(val);
                    }
                },
                // 'onRemoveTag':callback_function,
                // 'onChange' : callback_function,
                'delimiter': [','],   // Or a string with a single delimiter. Ex: ';'
                'removeWithBackspace' : true,
                'minChars' : 1,
                'maxChars' : 5, // if not provided there is no limit
                'placeholderColor' : '#666666'
            });

        </script>
    </body>
</html>